package com.lipaluma.xml.validator;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;

import com.lipaluma.field.validator.ValidatorFactory;

@XmlRootElement(name=XmlMatchesValidator.MATCHES)
@XmlAccessorType(XmlAccessType.FIELD)
public class XmlMatchesValidator implements XmlValidator {
	public static final String MATCHES = "matches";
	
	@XmlAttribute(required=true)
	private String regex;

	@Override
	public String getFunctionValidation() {
		return ValidatorFactory.VALIDATION_MATCHES_FUNCTION;
	}

	public String getRegex() {
		return regex;
	}
}
